import 'package:json_annotation/json_annotation.dart';
import 'package:lazy_food/models/note_model.dart';
import 'image_model.dart';
import 'video_model.dart';
part 'recipe_model.g.dart';

@JsonSerializable()
class RecipeModel {
  bool? collected_by_req_user;
  String create_time;
  VideoModel desc_square_video;
  VideoModel desc_video;
  String difficulty_text;
  int id;
  ImageModel image;
  int n_collects;
  int n_comments;
  int n_notes;
  int n_views;
  String name;
  String name_adj;
  String serving_unit;
  int serving_value;
  ImageModel square_image;
  VideoModel square_video;
  String time_consuming;
  String tips;
  bool unlocked;
  String? update_time;
  String url;
  VideoModel video;
  int watch_type;
  NoteModel? note;

  RecipeModel(
      this.collected_by_req_user,
      this.create_time,
      this.desc_square_video,
      this.desc_video,
      this.difficulty_text,
      this.id,
      this.image,
      this.n_collects,
      this.n_comments,
      this.n_notes,
      this.n_views,
      this.name,
      this.name_adj,
      this.note,
      this.serving_unit,
      this.serving_value,
      this.square_image,
      this.square_video,
      this.time_consuming,
      this.tips,
      this.unlocked,
      this.url,
      this.video,
      this.watch_type);

  factory RecipeModel.fromJson(Map<String, dynamic> json) =>
      _$RecipeModelFromJson(json);

  Map<String, dynamic> toJson() => _$RecipeModelToJson(this);
}
